<?php

use Phinx\Migration\AbstractMigration;

class AddColumnIsShowInMenuRouteTable extends AbstractMigration
{
    public function up()
    {
        $this->table("menu_route")
            ->addColumn("is_show", "enum", [
                "values" => "yes,no",
                "default" => "yes",
                "null" => false,
                "comment" => "是否显示",
            ])
            ->addColumn("type", "enum", [
                "values" => "normal,dynamic",
                "default" => "normal",
                "null" => false,
                "comment" => "路由类型 动态/普通路由",
            ])
            ->save();
    }

    public function down()
    {
        $this->table("menu_route")
            ->removeColumn("is_show")
            ->removeColumn("type")
            ->save();
    }
}
